#pragma once
#include <allegro5/allegro_primitives.h>
#include <math.h>

// simply power
float power(float a, int x);

// pseudo-random noise
double noise(double x,double y);

// cosine interpolation between two points
double interpolate(double a,double b,double x);

// Perlin noise for specified point (-1.0 to 1.0 in return)
double perlin2D(double x,double y);

// cloudy image bitmap
ALLEGRO_BITMAP* getPerlinNoise(int aW, int aH, double aZoom = 50, double aP = 0.5, int aOctaves = 8, int aSeed = 0);

// get pixel color
int getPixel(ALLEGRO_BITMAP* aImg, int aX, int aY);